%% Author: tangj
%% Created: 2012-9-21
%% Description: TODO: Add description to tool
-module(tool).

%%
%% Exported Functions
%%
-export([get_config/2,
		 for/3]).

%%
%% API Functions
%%

%% 获取应用配置
get_config(App, Key) ->
    case application:get_env(App, Key) of
 	{ok, false} -> throw(undefined);
	{ok, Value} -> Value;
 	undefined 	-> throw(undefined)
    end.

%% for
for(Max,Max,F)->[F(Max)];
for(I,Max,F)->[F(I)|for(I+1,Max,F)].

%%
%% Local Functions
%%

